import request from "@/router/axios";


export const getList = (current,size,params) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com-doc/list-out',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getMaterialList = (current,size,data) => {
  return request({
    url: '/api/hg-public/material/info/page',
    method: 'get',
    params: {
      ...data,
      current,
      size,
      materialFlag:'N',
    }
  })
}



export const getMaterialInfo = (id)=>{
  return request({
    url: '/api/hg-public/material/info/info2',
    method: 'get',
    params:{
      id,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com-doc/add-out',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com-doc/update',
    method: 'post',
    data: row
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com-doc/remove',
    method: 'delete',
    params: {
      ids,
    }
  })
}

export const commit = (id) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com-doc/submit',
    method: 'post',
    params: {
      id,
    }
  })
}

export const getNumber = (prefix) => {
  return request({
    url: '/api/hg-logistics/numbergenerator',
    method: 'get',
    params: {
      prefix,
    }
  })
}

export const getUserList = (current,size,params) => {
  return request({
    url: '/api/blade-system/personnelinfo/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getUserInfo = (id) => {
  return request({
    url: '/api/blade-system/personnelinfo/detail',
    method: 'get',
    params: {
      id,
    }
  })
}



export const addReturn = (row) => {
  return request({
    url: '/api/hg-logistics/materialcom/material-com-doc/add-in-give-back',
    method: 'post',
    data: row
  })
}
